<!-- 需求信息 -->
<template>
	<view class="page">
		<!-- 需求信息 -->
		<NeedsInfo></NeedsInfo>
		<!-- 上传照片 -->
		<UploadPic></UploadPic>
		<!-- 作业地址 -->
		<WorkAddress></WorkAddress>
		<!-- 按钮 -->
		<BottomOperation></BottomOperation>
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import { onLoad, onUnload } from "@dcloudio/uni-app";
	import { usePostNeedStore } from './store.js';
	import NeedsInfo from './components/needs-info.vue';
	import UploadPic from './components/upload-pic.vue';
	import WorkAddress from './components/work-address.vue';
	import BottomOperation from './components/bottom-operation.vue';

	const store = usePostNeedStore();

	onLoad((options) => {
		if (options.tab) store.SET_FORM_DATA('category', options.tab); // 添加
		if (options.id) {
			store.getDetail(options.id); // 编辑
			uni.setNavigationBarTitle({
				title: '编辑需求信息'
			});
		}
	});

	onUnload(() => {
		store.RESET_STORE();
	});
</script>

<style lang="scss" scoped>

</style>